package com.travel.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.GenericGenerator;
import xyz.erupt.annotation.Erupt;
import xyz.erupt.annotation.EruptField;
import xyz.erupt.annotation.sub_field.Edit;
import xyz.erupt.annotation.sub_field.View;

import javax.persistence.*;

@Entity
@Table(name = "travel_news")
@Erupt(name = "资讯管理")
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "travel_news")
@Schema(description = "资讯管理表")
public class TravelNews {
    /**
     * 资讯ID
     */
    @Id
    @GeneratedValue(generator = "generator")
    @GenericGenerator(name = "generator", strategy = "native")
    @Column(name = "id")
    @EruptField
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 标题
     */
    @EruptField(
            views = @View(title = "标题"),
            edit = @Edit(title = "标题")
    )
    private String title;
    /**
     * 内容
     */
    @EruptField(
            views = @View(title = "内容"),
            edit = @Edit(title = "内容")
    )
    private String content;

}
